package com.fengniaoxls.fengniaonewretail.commom.constants;

import com.freak.httphelper.log.LogUtil;

/**
 * 常量
 *
 * @author Administrator
 * @date 2019/2/19
 */

public class Constants {
    /**
     * 切换服务器地址只需要修改对应的serverTYpe即可
     * DEBUG          sit测试环境（调试接口环境）
     * UAT            uat测试环境（模拟生产测试环境）
     * RELEASE        生产环境（线上服务器）
     * OTHER          同事主机IP服务器（需要同事协助调试时使用）
     */
//    public final static String SERVER_TYPE = "UAT";
    public final static String SERVER_TYPE = "DEBUG";
//    public final static String SERVER_TYPE = "RELEASE";
//    public final static String SERVER_TYPE = "OTHER";

    public static final String UO_LOGIN = "用户未登录";
    public static final String ACCESS_TOKEN = "access_token";
    public static final String TOKEN_TYPE = "token_type";
    public static final String REFRESH_TOKEN = "refresh_token";
    public static final String EXPIRES_IN = "expires_in";
    public static final String SCOPE = "scope";
    public static final String REAL_NAME = "realName";
    public static final String THIRD_SYS_USER_CODE = "thirdSysUserCode";
    public static final String THIRD_SYS_CODE = "thirdSysCode";
    public static final String ICON_PATH = "iconPath";
    public static final String USER_CODE = "userCode";
    public static final String TOKEN_REFRESH_TIME = "tokenRefreshTime";
    public static final String SUCCESS_CODE = "000000";
    public static final String LOGIN_OUT_CODE = "00021";
    public static final String REFRESH_TOKEN_FAIL = "-1";
    public static final int LOGIN_OUT_REQUEST = 21000;
    public static final int LOGIN_OUT_RESULT = 22000;
    public static final String LOGIN_STATUS = "loginOut";
    public static final int LOGIN_REQUEST_CODE = 10000;
    public static final String VOICE_OPEN_STATUS = "Printer_Open_Status";
    public static final String TERMINAL_NUMBER = "terminal_number";
    public static final String SEQUENCE = "SEQUENCE";
    public static final String USERNAME = "USERNAME";
    public static final String PASSWORD = "PASSWORD";


    /**
     * 获取服务器地址
     *
     * @param serverType
     * @return
     */
    public static String getBaseUrl(String serverType) {
        LogUtil.e("当前状态——》"+serverType);
        String serverUrl;
        switch (serverType) {
            //测试服务器
            case "DEBUG":
                serverUrl = "http://192.168.1.90:3032/";
//                serverUrl = "http://192.168.1.129:3032/";
                break;
            //UAT测试服务器
            case "UAT":
                serverUrl = "http://uat.route.hangmuxitong.com/";
                break;
            //生产服务器
            case "RELEASE":
                serverUrl = "https://xls.yunfastpay.com/";
                break;
            //同事主机IP服务器
            case "OTHER":
                serverUrl = "http://192.168.1.218:3035/";
                break;
            default:
                serverUrl = "http://192.168.1.247:3032/";
                break;
        }
        return serverUrl;
    }

    /**
     * 获取商城服务器地址
     *
     * @param serverType
     * @return
     */
    public static String getMall(String serverType) {
        String serverUrl;
        switch (serverType) {
            //测试服务器
            case "DEBUG":
                serverUrl = "http://192.168.1.89:8681/";
                break;
            //UAT测试服务器
            case "UAT":
                serverUrl = "http://uat.route.hangmuxitong.com/mobile/";
                break;
            //生产服务器
            case "RELEASE":
                serverUrl = "https://xls.yunfastpay.com/mobile/";
                break;
            //同事主机IP服务器
            case "OTHER":
                serverUrl = "http://192.168.1.128:8681/mobile/";
                break;
            default:
                serverUrl = "http://192.168.1.126/";
                break;
        }
        return serverUrl;
    }
}
